package com.example.myapplication0302;

import android.os.Bundle;
import android.view.View;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;

import com.example.myapplication0302.adapter.MyAdapter;

public class RecycleViewActivity extends AppCompatActivity {
    private RecyclerView mRecyclerView;
    private MyAdapter myAdapter;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_recycler);
        mRecyclerView = findViewById(R.id.rv_content);

        //recycelrview 必须要调用setLayoutManger 才能显示出列表
        LinearLayoutManager manager = new LinearLayoutManager(this);
        mRecyclerView.setLayoutManager(manager);

        myAdapter = new MyAdapter();
        //和提供数据及展示的适配器关联
        mRecyclerView.setAdapter(myAdapter);
    }


//    public class Adapter<T> {
//    }
}
